package com.vshining.cryptoki.jna.pkcs11t;

import com.sun.jna.NativeLong;
import com.sun.jna.Structure;

import java.util.Arrays;
import java.util.List;

/**
 * @author Shining Wang <shiningwang@vshining.com>
 */
@SuppressWarnings("unused")
public class CK_MECHANISM_INFO extends Structure {
    public NativeLong ulMinKeySize;
    public NativeLong ulMaxKeySize;
    public NativeLong flags;

    @Override
    protected List getFieldOrder() {
        return Arrays.asList(
                "ulMinKeySize",
                "ulMaxKeySize",
                "flags"
        );
    }

    public static final long CKF_HW = 0x00000001L;
    public static final long CKF_ENCRYPT = 0x00000100L;
    public static final long CKF_DECRYPT = 0x00000200L;
    public static final long CKF_DIGEST = 0x00000400L;
    public static final long CKF_SIGN = 0x00000800L;
    public static final long CKF_SIGN_RECOVER = 0x00001000L;
    public static final long CKF_VERIFY = 0x00002000L;
    public static final long CKF_VERIFY_RECOVER = 0x00004000L;
    public static final long CKF_GENERATE = 0x00008000L;
    public static final long CKF_GENERATE_KEY_PAIR = 0x00010000L;
    public static final long CKF_WRAP = 0x00020000L;
    public static final long CKF_UNWRAP = 0x00040000L;
    public static final long CKF_DERIVE = 0x00080000L;
    public static final long CKF_EC_F_P = 0x00100000L;
    public static final long CKF_EC_F_2M = 0x00200000L;
    public static final long CKF_EC_ECPARAMETERS = 0x00400000L;
    public static final long CKF_EC_NAMEDCURVE = 0x00800000L;
    public static final long CKF_EC_UNCOMPRESS = 0x01000000L;
    public static final long CKF_EC_COMPRESS = 0x02000000L;
    public static final long CKF_EXTENSION = 0x80000000L;

}
